$(document).ready(function(){
	$(".top-menu li").hover(
		function(){
			$(this).addClass("cur").siblings().removeClass("cur");
		},
		function(){
			$(this).removeClass("cur");
		}
	);


    $("#trade_time_start,#trade_time_end").datebox();

    $("#record_search").click(function(){
    	var start_time=$("#record_form input[name=trade_time_start]").val();
        var query="";
    	var end_time=$("#record_form input[name=trade_time_end]").val();
        if(start_time) query+="&start_time="+start_time;
        if(end_time) query+="&end_time="+end_time;
    	var record_type=$("#record_form #record_type").val();
    	switch(record_type){
    		case "inpour":
    			window.location.href="index.php?c=index&a=inpour_page"+query;
    			break;
            case "draw":
                window.location.href="index.php?c=index&a=withdraw_page"+query;
                break;
            case "balance":
                window.location.href="index.php?c=index&a=balance_detail"+query;
                break;
            case "trade":
                var link="index.php?c=index&a=trade_record"+query;
                var status=$("#record_form select[name=status]").val();
                status=$.trim(status);
                if(status || status==='0') link+="&status="+status;
                var seller_name=$("#record_form input[name=seller_name]").val();
                if(seller_name) link+="&seller_name="+seller_name;
                var goods_name=$("#record_form input[name=goods_name]").val();
                if(goods_name) link+="&goods_name="+goods_name;
                window.location.href=link;
                break;
    	}
    });


});

function filter_query(){

}